import { FormSchema, FormProps } from '/@/components/Form';
import { mainserachstate } from '/@/enums/dateTypeEnum';
import { alleqtClass } from '/@/api/sys/brand/brand';
import type { DynamicProps } from '/#/utils';
type Props = Partial<DynamicProps<FormProps>>;

export const searchSchemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '名称',
    labelWidth: 60,
    componentProps: {
      placeholder: '请输入名称',
    },
    colProps: {
      lg: 6,
      xl: 4,
      xxl: 4,
    },
  },
  {
    field: 'category_id',
    component: 'ApiSelect',
    label: '设备分类',
    labelWidth: 100,
    componentProps: () => {
      return {
        api: alleqtClass,
        labelField: 'name',
        valueField: 'id',
        resultField: 'list',
      };
    },
    colProps: {
      lg: 6,
      xl: 4,
      xxl: 4,
    },
  },
  {
    field: 'code',
    component: 'Input',
    labelWidth: 60,
    label: '编码',
    componentProps: {
      placeholder: '请输入编码',
    },
    colProps: {
      lg: 6,
      xl: 4,
      xxl: 4,
    },
  },
  {
    field: 'tag_name',
    component: 'Input',
    labelWidth: 90,
    label: '标签名称',
    componentProps: {
      placeholder: '请输入标签名称',
    },
    colProps: {
      lg: 6,
      xl: 4,
      xxl: 4,
    },
  },
  {
    field: 'device_status',
    component: 'Select',
    label: '整体状态',
    labelWidth: 80,
    componentProps: {
      placeholder: '请选择',
      options: mainserachstate,
    },
    colProps: {
      lg: 6,
      xl: 4,
      xxl: 4,
    },
  },
];

export const serchConfig: Props = {
  schemas: searchSchemas,
};
